﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Reset Password</title>
    <link href="~/content/web/style.css" rel="stylesheet" />
    <link href="~/content/web/ResetPassword.css" rel="stylesheet" />
</head>
<body>
    <header class="style-bg-black">
        <h3 class="style-green"><img src="~/images/csclogo.png" alt=""> Customer Service Center</h3>
    </header>
    <div class="container">
        <div class="reset">
            <label id="ErrorInfo"></label>
                <table>
                    <tr>
                        <td>
                            <input type="password" id="oldPassword" name="oldPassword" placeholder="Old Password">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="password" id="newPassword" name="newPassword" placeholder="New Password">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="password" id="confirmPassword" name="confirmPassword" placeholder="Confirm Password">
                        </td>
                    </tr>
                    <tr>
                        <td class="btnTr">
                            <button class="style-bg-green" onclick="modifyPassword()">Confirm</button>
                        </td>
                    </tr>
                </table>
        </div>
    </div>
    <script src="~/scripts/jquery-1.8.2.min.js"></script>
    <script>
        function modifyPassword() {
            $.ajax({
                url: "/api/Home/modifyPassword",
                data: { 'NewPassword': $("#newPassword").val(), 'OldPassword': $("#oldPassword").val(), 'ConfirmPassword': $("#confirmPassword").val(), },
                dataType: "json",
                type:"post",
                success: function (info) {
                    if ( null != info) {
                        $("#ErrorInfo").html(info);
                    } else {
                        location.href = "../Home/Login";
                    }
                }
            });
        } 

    </script>
</body>


 
</html>

